using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data;
using MongoDB.Driver.Linq;
using MongoDB.Driver;
using BlueLotus7.SSQAnalyzeWebService.Properties;

namespace BlueLotus7
{
    public sealed class MongoOperator
    {
        #region Properties

        public MongoServer Server
        {
            get;
            protected set;
        }

        public MongoDatabase Database
        {
            get;
            protected set;
        }

        #endregion

        #region Constructor

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="sqlConnection">The database connection string.</param>
        public MongoOperator(string sqlConnection, string databaseName)
        {
            this.Server = MongoServer.Create(sqlConnection);
            this.Database = this.Server.GetDatabase(databaseName);
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        public MongoOperator(string databaseName)
            : this(Settings.Default.MongoConnection, databaseName)
        {
        }

        #endregion
    }
}
